home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
tex
/
tex31
/
texsrc.lzh
/
COMMON.LZH
/
MAIN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-13
|
999b
|
51 lines
/* main.c -- the usual main program. */
#include "extra.h"
/* The command line is stored here, since Pascal has usurped `argv'
for a procedure. */
static char **gargv;
/* Referenced from the Pascal, so not static. */
integer argc;
#ifdef atarist
int _stksize = -1L;
#endif
/* The entry point for all the programs except TeX and Metafont, which
have more to do. We just have to set up the command line. Pascal's
main block is transformed into the procedure `main_body'. */
void
main (ac, av)
int ac;
char **av;
{
argc = ac;
gargv = av;
#ifdef atarist
if (!getenv ("UNIXMODE"))
_set_unixmode ("dr/");
_binmode (1); /* Make sure to open all files in */
/* binary mode */
#endif
main_body ();
exit (0);
}
/* Read the Nth argument from the command line. BUF is a Pascal
string, i.e., it starts at index 1 and ends with a space. */
void
argv (n, buf)
int n;
char buf[];
{
(void) strcpy (buf + 1, gargv[n]);
(void) strcat (buf + 1, " ");
}